package com.pozu.new_retail.utils;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

public class PropertiesUtil {

	private static Properties props;
	
	private static Map<String,String> map = new HashMap<String,String>();

	
	private static void init(){
		props = new Properties();
		try {
			props.load(PropertiesUtil.class.getClassLoader()
					.getResourceAsStream("config/constant.properties"));
			for(String key:props.stringPropertyNames()){
				map.put(key,props.getProperty(key));
			}
			
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	public static String getString(String key){
		if(map.isEmpty()){
			init();
		}
		return map.get(key);
	}
}
